GtkListBox: minor fix
authorAlexander Larsson <alexl@redhat.com>
Wed, 12 Jun 2013 11:08:36 +0000 (13:08 +0200)
committerAlexander Larsson <alexl@redhat.com>
Thu, 13 Jun 2013 10:17:08 +0000 (12:17 +0200)
Move the check inside the existing chech which also checks
for active_row != NULL for extra safety.

gtk/gtklistbox.c

index 1ec189102c5cd1bf54b4cf48e1c837f09e19ed43..6a7769949484eccc5043ca9d53254a777bc95ee7 100644 (file)
@@ -1242,10 +1242,10 @@ gtk_list_box_real_button_release_event (GtkWidget *widget,
             gtk_list_box_select_and_activate (list_box, priv->active_row);
           else
             gtk_list_box_update_selected (list_box, priv->active_row);
+
+          gtk_widget_unset_state_flags (GTK_WIDGET (priv->active_row),
+                                        GTK_STATE_FLAG_ACTIVE);
         }
-      if (priv->active_row_active)
-        gtk_widget_unset_state_flags (GTK_WIDGET (priv->active_row),
-                                      GTK_STATE_FLAG_ACTIVE);
       priv->active_row = NULL;
       priv->active_row_active = FALSE;
       gtk_widget_queue_draw (GTK_WIDGET (list_box));